<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<div class="t_bar">
	<span class="color_red">*</span><span>课题备案情况</span>
</div>
<table class="t_css table01" width="100%" border="0" cellpadding="0" id="orgInfo" cellspacing="1">
	<col style="width:25%"/>
	<col style="width:25%"/>
	<col style="width:25%"/>
	<col style="width:25%"/>

	<tr class="li_1">
		<td align="right" nowrap>项目名称：</td>
		<td colspan="3">
			<input id="zh_title"  name="proposal/zh_title" label="项目名称" type="text" required class="input_css required maxlength:100"  style="width:95%" maxlength="100" value="<x:out select="$xmlData/data/proposal/zh_title" />"/>
		</td>
	</tr>
	<tr class="li_2">
		<td align="right" nowrap>归口管理部门：</td>
		<td colspan="3">
			<c:set var="recomend_org">
				{'id':'<x:out select="$xmlData/data/proposal/recomend_org_value" />',
				'name':'<x:out select="$xmlData/data/proposal/recomend_org_name" />'}
			</c:set>
			<cpt:tree key="recommended_org" cacheable="false" className="hn_iuput_kuang " readonly="true" value="${recomend_org}"  id="recomend_org" showPattern="all" shieldPattern="0"
					  topCheckbox="false" onClick="initTreeValueExt" />
			<input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value" style="width: 80%;" class="required" value="<x:out select="$xmlData/data/proposal/recomend_org_value" />" label="归口管理部门">
			<input type="hidden" name="proposal/recomend_org_name" style="width: 80%;" value="<x:out select="$xmlData/data/proposal/recomend_org_name" />">
		</td>
	</tr>
	<tr class="li_1">
		<td align="right" nowrap>项目负责人：</td>
		<td>
			<span name="proposal/fzr_psnname" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name" /></span>
		</td>
		<td align="right">手机号：</td>
		<td>
			<span name="proposal/fzr_mobile" >
				<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile" />
			</span>
		</td>
	</tr>

	<tr class="li_2">
		<td align="right">联系电话：</td>
		<td nowrap  colspan="1">
			<input type="text" oninput="value=value.replace(/[^\d]/g,'')" label="联系电话" name="proposal/fzr_tel_work" id="fzr_tel_work" class="input_css required"
				   maxlength="11" value="<x:out select="$xmlData/data/proposal/fzr_tel_work" />"  />
		</td>
		<td align="right">电子邮箱：</td>
		<td nowrap  colspan="2">
			<span name="proposal/fzr_email" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email" /></span>
		</td>
	</tr>
	<tr class="li_1">
		<td align="right">
			单个横向课题实际到账总金额（万元）：
		</td>
		<td width="350px">
			<input name="proposal/actural_sum" label="单个横向课题实际到账总金额" type="text" id="acturalMoney"
				   required class="input_text required" style="text-align:right" onfocus="InitInput.setNumber(this,7,4,2)" value="<x:out select="$xmlData/data/proposal/actural_sum"/>">
		</td>
		<td align="right">验收情况：</td>
		<td align="right">
			<cpt:checkbox key="accept_situation" name="accept_situation" repeatColumn="4" tagType="radio" ></cpt:checkbox>
			<input type="hidden" id="accept_situation" name="proposal/accept_situation_value" class="required" label="验收情况" value="<x:out select="$xmlData/data/proposal/accept_situation_value" />" label="验收情况">
			<input type="hidden" name="proposal/accept_situation_name" value="<x:out select="$xmlData/data/proposal/accept_situation_name" />">
		</td>
	</tr>
	<tr>
		<td align="right">通讯地址：</td>
		<td colspan="3" >
			<input   name="proposal/tjbm_org_address" maxlength="50"  label="${param.title}-->通讯地址" type="text" required class="input_css required" style="width:78%"  value="<x:out select="$xmlData/data/proposal/tjbm_org_address" />"/>
		</td>
	</tr>
	<tr>
		<td  align="right" >申报日期：</td>
		<td colspan="3">
			<c:set var="submit_date"><x:out select="$xmlData/data/proposal/submit_date" /></c:set>
			<cpt:date id="apply_date_curr" name="proposal/submit_date" value="${submit_date}" className="required date" label="申报日期"></cpt:date>
		</td>
	</tr>
</table>



<input type="hidden" id="org_name" value="<x:out select="$xmlData/data/organizations/organization[@submit_org=1]/org_name"/>">
<div class="t_bar">
	单个横向课题到账经费明细(万元/笔)</div>
<table  id="tblTableAddNew" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
	<thead >
	<tr style="border:1px solid #B7D1E6">
		<th class="TblHead" align="center"  width="5%">选择</th>
		<th class="TblHead" align="center"  width="5%">序号</th>
		<th class="TblHead" align="center"  width="10%">合同名称</th>
		<th class="TblHead" align="center" width="16%">合同开始日期</th>
		<th class="TblHead" align="center" width="16%">合同结束日期</th>
		<th class="TblHead" align="center"  width="16%">委托方名称</th>
		<th class="TblHead" align="center"  width="16%">到账经费（万元）</th>
	</tr>
	</thead>
	<tbody id="tab">
	<tr style="display:none">
		<td align="center">&nbsp;
			<input type="radio" style="border: 0px;background-color: white;" class="radiobutton" name="selMileStones" >
		</td>
		<td align="center"><span name="tableaddnews|milestone[0]@seq_no" >[index]</span>
		</td>
		<td align="center"><input  id="unit_[0]" name="tableaddnews|milestone[0]|unit" label="合同名称" value="" maxlength="100" class=" required input_text" style="width:85%">
		</td>
		<td align="center">&nbsp;
			<input  id="milestone_start_date_[0]" name="tableaddnews|milestone[0]|start_date" label="合同开始日期"value="" class=" required input_text date  dateCompare:milestone_end_date_[0] dateCompareAfterE:milestone_start_date_[0]:start_date_compare" style="width:70px" label="合同开始日期" />
		</td>
		<td align="center">&nbsp;<input  id="milestone_end_date_[0]" name="tableaddnews|milestone[0]|end_date" label="合同结束日期" value="" class=" required input_text date dateCompareBeforeE:milestone_end_date_[0]:end_date_compare " style="width:70px" label="合同结束日期" /> </td>
		<td align="center"><input name="tableaddnews|milestone[0]|lxr_name" class="input_text required" maxlength="100" label="委托方名称" style="width: 85%;"/>
		<td align="center"><input name="tableaddnews|milestone[0]|lxr_phone" class="input_text required" maxlength="100" onfocus="InitInput.setNumber(this,7,4,2)" label="到账经费" style="width: 85%; text-align:right; "/>
		</td>
	</tr>

	<c:set value="0" var="index" scope="page"/>
	<x:forEach select="$xmlData/data/tableaddnews/milestone" var="milestone">
		<c:choose>
			<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
			<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
		</c:choose>
		<tr >
			<td align="center">&nbsp;
				<input type="radio" style="border: 0px;background-color: white;" class="radiobutton" name="selMileStones" >
			</td>
			<td align="center">
				<span name="tableaddnews/milestone[${flag}${index}]@seq_no" ><x:out select="$milestone/@seq_no"/></span>
			</td>
			<td align="center">
				<input   value="<x:out select="$milestone/unit"/>" label="合同名称" name="tableaddnews/milestone[${flag}${index}]/unit" maxlength="100" class="required  input_text "  style="width:85%"/>
			</td>
			<td align="center">&nbsp;
				<c:set var="start_date" scope="page"><x:out select="$milestone/start_date"/></c:set>
				<input  id="milestone_start_date_[${flag}${index}]" value="${start_date}" label="合同开始日期" name="tableaddnews/milestone[${flag}${index}]/start_date" class="required date input_text dateCompare:milestone_end_date_[${flag}${index}] dateCompareAfterE:milestone_start_date_[${flag}${index}]:start_date_compare"  style="width:70px" label="合同开始日期" />
			</td>
			<td align="center">&nbsp;
				<c:set var="end_date" scope="page"><x:out select="$milestone/end_date"/></c:set>
				<input  id="milestone_end_date_[${flag}${index}]" name="tableaddnews/milestone[${flag}${index}]/end_date" label="合同结束日期" value="${end_date}" class="required date input_text dateCompareBeforeE:milestone_end_date_[${flag}${index}]:end_date_compare" style="width:70px" label="合同结束日期" /> </td>
			<td align="center"><input name="tableaddnews/milestone[${flag}${index}]/lxr_name" class="input_text required " label="委托方名称" maxlength="100" style="width: 85%;" value="<x:out select="$milestone/lxr_name"/>">
			</td>
			<td align="center"><input name="tableaddnews/milestone[${flag}${index}]/lxr_phone" class="input_text required " label="到账经费" maxlength="100" style="width: 85%; text-align:right; " onfocus="InitInput.setNumber(this,7,4,2)" value="<x:out select="$milestone/lxr_phone"/>">
			</td>
		</tr>
		<c:set value="${index+1}" var="index" scope="page"/>
	</x:forEach>
	</tbody>
</table>


<table width="98%" align="center">
	<tr ><td>
		<input class="button" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimit('tblTableAddNew',10,'高校科研院所横向课题备案到账经费明细最多只能填写10条')){addNewRow('tblTableAddNew');showDateTag('tblTableAddNew');}try{top.resizeFrame();}catch(e){};">
		<input class="button" name="cmdMovePrev" type=button value="上移" onclick="movePrev('tblTableAddNew','selMileStones')">
		<input class="button" name="cmdMoveNext" type=button value="下移" onclick="moveNext('tblTableAddNew','selMileStones')">
		<input class="button" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('tblTableAddNew','单个横向课题到账经费明细')">
	</td></tr>
</table>



<script type="text/javascript">

	showAllDateTag("tblTableAddNew");

	function initTreeValueExt(treeId, treeNode) {
		if ((treeNode && treeNode.isParent)) {
			scmWarn("请选择具体的" + $("#" + treeId).attr("label"));
			$("#" + treeId).val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId	+ "_value']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val("");
			return false;
		}
		var str = treeNode.name;
		var obj = treeNode.parentNode;
		while (obj != null) {
			obj = obj.parentNode;
		}

		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
	}

</script>